<template>
  <view class="page">
    <view class="list">
      <view class="title">
        <view class="">
          <text class="name">{{pkg.companyName}}</text>
          <text class="num">共{{pkg.itemList.length}}项</text>
        </view>
        <!-- <view class="money">¥{{sumBaseMoney | fixed}}</view> -->
      </view>
      <view class="item" v-for="(item,index) in pkg.itemList" :key="index">
        <view>{{item.itemName}}</view>
        <view class="money">¥{{item.itemAmt}}</view>
      </view>
    </view>
    <!-- <view class="list">
      <view class="title">
        <view class="">
          <text class="name">自选项</text>
          <text class="num">共{{checkList.length}}项</text>
        </view>
        <view class="money">¥{{checkList.reduce((sum, e) => sum + Number(e.itemAmt || 0), 0) | fixed}}</view>
      </view>
      <view class="item" v-for="(item,index) in checkList" :key="index">
        <view>{{item.itemName}}</view>
        <view class="money">¥{{item.itemAmt}}</view>
      </view>
    </view> -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        checkList: [],
        pkg: []
      }
    },
    computed: {
      // sumBaseMoney() {
      //   return this.baseList.reduce((sum, e) => sum + Number(e.itemAmt || 0), 0)
      // },
    },
    onLoad(opt) {
      console.log(opt)
      // this.checkList = JSON.parse(opt.checkItems)
      this.pkg = JSON.parse(opt.pkg)
      console.log(this.pkg)
      // this.baseList = JSON.parse(opt.baseItems)
    },
    methods: {
      
    }
  }
</script>

<style lang="less" scoped>
.list {
  flex: 1;
  padding: 16upx;
  background-color: #FFF;
  border-radius: 8px;
  overflow: auto;
  &:nth-child(1) {
    margin-bottom: 24upx;
  }
  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 54upx;
    position: relative;
    padding-left: 24upx;
    &:before {
      content: '';
      width: 6upx;
      height: 28upx;
      background: #366AA4;
      border-radius: 6upx;
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
    }
    .name {
      font-family: PingFang SC, PingFang SC;
      font-weight: 600;
      font-size: 28upx;
      color: rgba(0,0,0,0.7);
    }
    .num {
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 24upx;
      color: rgba(0,0,0,0.4);
      margin-left: 24upx;
    }
  }
  .item {
    display: flex;
    justify-content: space-between;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 28upx;
    color: rgba(0,0,0,0.5);
    line-height: 44upx;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    padding: 24upx 0;
    .money {
      font-weight: 400;
    }
  }
}
.money {
  font-family: PingFang SC, PingFang SC;
  font-weight: 600;
  font-size: 32upx;
  color: #FFAA32;
  line-height: 44upx;
}
</style>
